# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessCalls.V1.Model.AggregateMetrics do
  @moduledoc """
  Metrics aggregated over the input time range.

  ## Attributes

  *   `answeredCallsCount` (*type:* `integer()`, *default:* `nil`) - Total count of answered calls.
  *   `endDate` (*type:* `GoogleApi.MyBusinessBusinessCalls.V1.Model.Date.t`, *default:* `nil`) - End date for this metric.
  *   `hourlyMetrics` (*type:* `list(GoogleApi.MyBusinessBusinessCalls.V1.Model.HourlyMetrics.t)`, *default:* `nil`) - A list of metrics by hour of day.
  *   `missedCallsCount` (*type:* `integer()`, *default:* `nil`) - Total count of missed calls.
  *   `startDate` (*type:* `GoogleApi.MyBusinessBusinessCalls.V1.Model.Date.t`, *default:* `nil`) - Date for this metric. If metric is monthly, only year and month are used.
  *   `weekdayMetrics` (*type:* `list(GoogleApi.MyBusinessBusinessCalls.V1.Model.WeekDayMetrics.t)`, *default:* `nil`) - A list of metrics by day of week.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :answeredCallsCount => integer() | nil,
          :endDate => GoogleApi.MyBusinessBusinessCalls.V1.Model.Date.t() | nil,
          :hourlyMetrics =>
            list(GoogleApi.MyBusinessBusinessCalls.V1.Model.HourlyMetrics.t()) | nil,
          :missedCallsCount => integer() | nil,
          :startDate => GoogleApi.MyBusinessBusinessCalls.V1.Model.Date.t() | nil,
          :weekdayMetrics =>
            list(GoogleApi.MyBusinessBusinessCalls.V1.Model.WeekDayMetrics.t()) | nil
        }

  field(:answeredCallsCount)
  field(:endDate, as: GoogleApi.MyBusinessBusinessCalls.V1.Model.Date)
  field(:hourlyMetrics, as: GoogleApi.MyBusinessBusinessCalls.V1.Model.HourlyMetrics, type: :list)
  field(:missedCallsCount)
  field(:startDate, as: GoogleApi.MyBusinessBusinessCalls.V1.Model.Date)

  field(:weekdayMetrics,
    as: GoogleApi.MyBusinessBusinessCalls.V1.Model.WeekDayMetrics,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessCalls.V1.Model.AggregateMetrics do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessCalls.V1.Model.AggregateMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessCalls.V1.Model.AggregateMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
